package com.adee.nowcoder.huawei;

import java.util.Scanner;

public class T071 {
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            String reg = in.nextLine();
            reg.replaceAll("\\?", "");
            String s = in.nextLine();
            boolean matches = s.matches(reg);
            System.out.println(matches);
        }
    }

    public static void main(String[] args) {
        String s = "te?t*.*";
        System.out.println(s.replaceAll("\\?", "!"));
        System.out.println(s.replaceAll("\\*", "!"));
        System.out.println("***hha".replaceAll("\\*{2,}", "*"));
    }
}
